package day12.demo1;

/**
 * @Auther:小陈的Java
 */
public class ThreadDemo6 extends Thread{
    public static void main(String[] args) throws Exception{
        ThreadDemo6 threadDemo6 = new ThreadDemo6();
        threadDemo6.setDaemon(true);
        threadDemo6.start();
        Thread.sleep(3000);
        System.out.println("主线程结束");

    }

    @Override
    public void run() {
        try {
            System.out.println("守护线程开始守护");
            Thread.sleep(5000);
            System.out.println("守护线程结束守护");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
